package com.orangelife.service.base.common;

import java.util.LinkedList;
import java.util.List;

import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;

/**
 * 返回数据时使用的实体，如果 hasTurnpage = false，表示没有翻页，
 * pageNo、pageSize就无效了，rowCount就表示了当前返回的记录数
 * 
 * @author Linchunh
 * 
 */
public class JsonGridEntity {
	private String title;
	private List<GridHeader> header = new LinkedList<GridHeader>();
	private List<List<String>> data = new LinkedList<List<String>>();

	/**
	 * 当前页码
	 */
	private int pageNo;

	/**
	 * 总记录数
	 */
	private int rowCount;

	/**
	 * 每页大小
	 */
	private int pageSize;

	@JsonSerialize(include = Inclusion.NON_NULL)
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@JsonSerialize(include = Inclusion.NON_NULL)
	public List<GridHeader> getHeader() {
		return header;
	}

	public void setHeader(List<GridHeader> header) {
		this.header = header;
	}

	@JsonSerialize(include = Inclusion.NON_NULL)
	public List<List<String>> getData() {
		return data;
	}

	public void setData(List<List<String>> data) {
		this.data = data;
	}

	@JsonSerialize(include = Inclusion.NON_NULL)
	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	@JsonSerialize(include = Inclusion.NON_NULL)
	public int getRowCount() {
		return rowCount;
	}

	public void setRowCount(int rowCount) {
		this.rowCount = rowCount;
	}

	@JsonSerialize(include = Inclusion.NON_NULL)
	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

}
